package com.suray.basic.wcs.plc.utils;

/**
 * 0:无效 1:拆叠  2:叠盘   3:进整托     4:出整托
 */
public enum FoldingMachineAction {
    INVALID(0, "无效"),
    REMOVE_PALLET(1, "拆盘"),
    STACK_PALLET(2, "叠盘"),
    ALL_IN(3, "进整托"),
    ALL_OUT(4, "出整托"),
    ;

    int value;
    String des;
    FoldingMachineAction(int value, String des) {
        this.value = value;
        this.des = des;
    }

    public int getValue() {
        return value;
    }

    public static FoldingMachineAction parseValue(int value) {
        for (FoldingMachineAction foldingMachineAction : FoldingMachineAction.values()) {
            if (foldingMachineAction.value == value) {
                return foldingMachineAction;
            }
        }

        return INVALID;
    }

    @Override
    public String toString() {
        return des;
    }
}
